










                         Computer Vision:                         

                     A Practical Introduction                     






















































                         Computer Vision:                         

                     A Practical Introduction                     




                           J. R. Parker                           

                     The University of Calgary                    

                  Department of Computer Science                  

                     Calgary, Alberta, Canada                     


















New York Chichester Brisbane Toronto Singapore














































Copyright (2016) by J Parker.

All rights reserved. Published simultaneously in Canada

Library of Congress Cataloging in Publication Data:

Parker, James Robert.

    Computer Vision: A Practical Introduction

    Bibliography: p. 325
    Includes index.
    1. Computer Vision. 2. Image Processing I. Title

TA 1632.P92 1992 629.8'92 92-28763



Printed in the United States of America


10 9 8 7 6 5 4 3 2 1




















Preface







        Computer  vision has become a high profile subject      in
    recent times. The reason is clear enough - for those of us who
    are  sighted, most of the information we acquire day to day is
    through vision. We are highly picture oriented      beings, as
    demonstrated by the prevalance of television, motion pictures,
    magazenes, and books.   Even in science much of the data has a
    visual    aspect:  photographs,  spectrograms,  chromatography
    images, and a host of other     visual means of accessing data
    pervade all scientific   disciplines. Indeed, when data is not
    visual we tend to make it so by drawing graphs and charts.

        Almost everyone has seen    a computer enhanced picture in
    the form of a    Voyager or Pioneer spacecraft image of one of
    the outer planets. Others have been exposed to computer images
    through the recent use of the     'morphing' technique used in
    some  recent music videos. Both have increased the      public
    awareness of the use    of computers in manipulating pictures,
    although  neither example actually represents computer vision.
    Voyager images more   properly illustrate image processing, in
    which mathematical and other    techniques are used to improve
    the quality of an image for some particular purpose.       For
    example, the Voyager images were actually black and white, and
    were subject to many    sources of noise and distortion. Image
    processing  methods  applied to a sequence of such      images
    allowed  the  beautifully  clear  full  color pictures    that
    appeared on television and    in print. In a similar vein, the
    digitally morphed sequences from the Michael     Jackson video
    were generated by applying a meld of      image processing and
    computer  graphics to films of carefully choreographed motions
    by actors. The result is a smooth transition between frames on
    the film, where it    is impossible to tell which parts of the
    pictures are real and which are computer generated.

        Computer  vision  is  involved  with  the extraction    of
    information  from  images,  and  in  the identification    and
    classification of objects in    an image. A friend of mine has
    referred to it as 'un-graphics', and     this is very near the
    mark.  Computer vision systems are used to recognize faces and
    signatures,  match fingerprints, inspect parts on     assembly
    lines,  and guide robots in assembly tasks. Of course there is
    an  aspect of image processing in all computer vision systems.
    Images need to be enhanced to     emphasize important features
    before the vision aspect can be     performed; and there is an
    aspect of computer   graphics in all vision systems, since the
    images must be displayed, windowed, and     scaled. Because of
    this, any book   on computer vision must contain some elements
    of these other fields.

        This book was written for the beginner in computer vision.
    It assumes only   basic mathematics such as would be taught in
    high school and   early college math courses. It does assume a
    knowledge  of  computers  and  programming terminology,    and
    examples  are coded in the C language so a facility in C would
    be useful. The intent is to provide a useful, if not complete,
    and  practical, if not completely rigorous, knowledge of basic
    computer vision. While it could be used      as a text in some
    computer science courses, it is intended     to be used by the
    general computing public, and by students of subjects in which
    computer vision is a useful tool. Examples      are drawn from
    astronomy, geography, geology, biology, and medicine.

        This book also contains code for a low-level vision system
    which I call Alpha (optimistically thinking that there may one
    day  be a Beta), which was developed on a Sun workstation, but
    which  is intended to compile and run on an IBM PC running Dos
    and Borland C. The diskette that accompanies this book has the
    source  code for Alpha as well as a set of images which should
    be useful for conducting experiments and for demonstrating the
    Alpha software. The sample images lend to the practical aspect
    of this book.   The reader has immediate access to images with
    which to test their own ideas and software.

        The  organization of this book is, I think, unique. Rather
    than  being  organized by type of operation     (enhancements,
    restorations, etc), this book is organized by      complexity.
    Following the introduction we start with an examination of the
    simplest kind of image, one with     only black or white. This
    chapter  covers  many  of  the  useful  operations  on     and
    measurements of bi-level pictures. Next we look      at images
    having  many levels of grey, and discuss enhancements      and
    measurements, including ways to convert to bi-level form. Next
    is a chapter on    high level representation of image objects,
    and the matching   of patterns. Finally there are a collection
    of  chapters each dealing with a different real problem in low
    level  computer vision. After the problem is explained      an
    attempt will be made to solve it using existing Alpha code and
    such new approaches   as are needed for the particular case. I
    feel  that this organization allows a clear flow of ideas, and
    the final chapters lend a practical     aspect to the book not
    found elsewhere.

        Of course there   is a lot of material not covered by this
    book. Restoration is   not covered at all, and filters, a vast
    subject, are only covered superficially. Three     dimensional
    vision is avoided, and so is the subject of color, since these
    areas deserve more coverage than is possible in a book at this
    level.  The basic idea here is to present to       scientists,
    engineers, and interested computer    users of all stripes the
    essential  ideas surrounding computer vision in an immediately
    usable and understandable fashion. The mathematics which is so
    key  to the development of the discipline is avoided in favour
    of  a more intuitive approach, and the hope is that sufficient
    interest will be generated by reading this book that       the
    reader will then pursue the subject further, in more depth.

        The text and   many of the computer generated figures were
    prepared using a Sun 3/60 and     Sparcstation 2, and code for
    Alpha  was  originally  designed using these machines.     The
    software for the diskettes was prepared     on an Packard-Bell
    notebook computer with a VGA card.

        Significant contributions to   this effort were made by my
    wife, Katrin, who suffered through the hours      and the mood
    swings,  and my children Adam and Bailey, who did the same and
    posed for some sample images. Thanks     to: Mike Williams for
    editorial help and   the use of his IBM computer; John Heerema
    for the use   of IBM PC hardware; and to the authors of the XV
    software for the Sun,    without which I would have been lost.
    Great  thanks for wonderful sample images goes to:      Gaston
    Groisman, former graduate   student and current friend; Cullen
    Jennings, current graduate student    and ISEF expert; Dr. Ata
    Sarajedini of Yale University;    Dr. Roland Auer and Dr. Fred
    Biddle of the   University of Calgary medical school Pathology
    Department;  Dr. R. MacLaughlan from the Biology Department at
    the University of Calgary; Dr. N.     Wardlaw from the Geology
    Department; Dr. M. Hawes and Dr. J. Engsberg of the University
    of  Calgary Human Performance Laboratory; Dr. R. Callaghan and
    Dr.  J.  Helmer  of  the University of Calgary     Archaeology
    Department;  the EECE Department of the University of      New
    Mexico  for the Khoros images and software; Dr. S. Kwok of the
    Department  of Physics and Astronomy for the Cygnus      X-ray
    image; Big Hill   Veterinary Services in Cochrane, Alberta for
    the animal X-rays; and    to NASA for the Voyager and Magellan
    data.




    Jim Parker
    Calgary, Alberta, Canada
    November, 1992.








































    Contents





    Preface

    1. Introduction

   1.1 Images as digital objects
   1.2 Image storage and display
   1.3 Image acquisition
   1.4 Image types and applications
   Summary
   Exercises


2. Bi-Level Images

   2.1 Usefulness of bi-level images
   2.2 Connectivity and geometry
   2.3 Measurable properties
   2.3.1 Area
   2.3.2 Perimeter
   2.3.3 Length
   2.3.4 Moments - center of mass
   2.3.5 Simple shape
   2.3.6 Derivative and Complex Shape Measures
   2.4 Operations on bi-level images
   2.4.1 Boundary enhancement
   2.4.2 Erosion and dilation
   2.4.3 Skeletonization
   2.4.4 Chain codes
   2.4.5 Run Length Encoding
   Summary
   Exercises


3. Grey Level Images

   3.1 Thresholding
   3.2.1 Selecting A Single Threshold
   3.2.2 Selecting Multiple Thresholds
   3.2 Grey level modification
   3.3 Lines and edges
   3.4 Geometric operations
   3.5 Noise
   3.6 Color
   Summary
   Exercises


4. Representing and Recognizing Objects

   4.1 Features
   4.2 Statistical Pattern Analysis
   4.3 Decision Functions
   4.4 Template Matching
   4.5 Structural Pattern Recognition
   4.4.1 Representing Relationships
   4.4.2 Identifying Components
   Summary
   Exercises


5. Counting and Classifying Objects

   5.1 Counting simple cells
   5.2 Classifying seeds
   5.3 Classifying galaxies
   5.4 Defects in printed circuit boards
   Summary
   Exercises


6. Computer Readable Codes

   6.1 The bar code
   6.2 Fonts for machine readable text
   6.3 The general OCR problem
   Summary
   Exercises


7. Scientific Images

   7.1 Chromatography
   7.2 Star images
   7.3 Synthetic Color Voyager Images
   7.4 Computer Vision In Archaeology
   Summary
   Exercises


Appendix A: The Alpha Vision System

Appendix B: Systems

Appendix C: Bibliography

Index








































      "We shall not all sleep; but we shall all be changed."      

                           II Cor. 16:19                          
